package org.sbear.Controller;

import org.sbear.service.EmailService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 电子邮件控制器
 *
 * @author xxyWi
 * @date 2021/02/05
 */
@RestController
public class EmailController {

    private final EmailService emailService;

    public EmailController(EmailService emailService) {
        this.emailService = emailService;
    }

    @RequestMapping("/email/{email}/{code}")
    public boolean email(@PathVariable String email, @PathVariable String code) {
        return emailService.email(email, code);
    }
}
